import { createRouter,createWebHistory } from "vue-router";

const routes = [
    {
        path: '/',
        redirect:'/discover'
    },
    {
        path: '/discover',
        name: 'discover',
        component: () => import('@/views/Discover/index.vue'),
        children:[
            {
                path:"/discover/toplist",
                name:'toplist',
                component: () => import('@/views/Discover/TopList/index.vue')
            },
            {
                path:"/discover/playlist",
                name:'playlist',
                component: () => import('@/views/Discover/PlayList/index.vue')
            },
            {
                path:"/discover/djradio",
                name:'djradio',
                component: () => import('@/views/Discover/DjRadio/index.vue')
            },
            {
                path:"/discover/artist",
                name:'artist',
                component: () => import('@/views/Discover/Artist/index.vue')
            },
            {
                path:"/discover/ablum",
                name:'ablum',
                component: () => import('@/views/Discover/Ablum/index.vue')
            },
            
        ]
    },
    {
        path: '/download',
        name: 'download',
        component: () => import('@/views/Download/index.vue')
    },
    {
        path: '/friend',
        name: 'friend',
        component: () => import('@/views/Friend/index.vue')
    },
    {
        path: '/my',
        name: 'my',
        beforeEnter(){
            document.body.style.overflow = 'hidden'
        },
        component: () => import('@/views/My/index.vue')
    }
]

const router = createRouter({
        history: createWebHistory(),
        routes
})


export default router;